﻿define(function (require, exports, module) {
    var manager = {
        timerId: null,
        start: function () {
            console.log('start notification manager');
            this.timerId = setInterval(getFeedsCallback, GETFEEDS_TIMER_INTERVAL);
            getFeedsCallback();
        },
        gettingFeedsCallback: function () {
            
        },
        isGettingFeeds: false,

        //useless
        stop: function () {
            console.log('stop notification manager');
            clearInterval(this.timerId);

        },
    };

    require('ezdesk/utility/datetime');
    var service = require('ezdesk/utility/service');

    var GETFEEDS_TIMER_INTERVAL = 10000;

    function getFeedsCallback() {
        console.log('getFeedsCallback start..');

        if (!manager.isGettingFeeds) {
            manager.isGettingFeeds = true;
            manager.gettingFeedsCallback();
        }
    }

    var notificationTimerId = 0;
    module.exports = manager;
});